// $ANTLR 3.0.1 C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g 2008-08-20 20:39:44

	package ac.jp.u_tokyo.SyncLib.valueParser;
	import java.util.LinkedList;
	import java.util.List;
	import java.util.Map;
	import java.util.HashMap;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class ValueParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "NULL", "TRUE", "FALSE", "DIGIT", "ULETTER", "LLETTER", "LETTER", "NUMBER", "NAME", "STRING", "WS", "','", "'{'", "'='", "'->'", "'}'"
    };
    public static final int LLETTER=9;
    public static final int NAME=12;
    public static final int WS=14;
    public static final int ULETTER=8;
    public static final int LETTER=10;
    public static final int NULL=4;
    public static final int NUMBER=11;
    public static final int DIGIT=7;
    public static final int EOF=-1;
    public static final int FALSE=6;
    public static final int TRUE=5;
    public static final int STRING=13;

        public ValueParser(TokenStream input) {
            super(input);
        }
        

    public String[] getTokenNames() { return tokenNames; }
    public String getGrammarFileName() { return "C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g"; }

    
    	public static Object[] parse(String text) throws RecognitionException {
    		ANTLRStringStream input = new ANTLRStringStream(text);
    		ValueLexer lexer = new ValueLexer(input);
    		ValueParser parser = new ValueParser(new CommonTokenStream(lexer));
    		return parser.prims().toArray(new Object[] {});
    	}



    // $ANTLR start prims
    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:52:1: prims returns [List<Object> result] : ( prim ( ',' )? )+ ;
    public final List<Object> prims() throws RecognitionException {
        List<Object> result = null;

        Object prim1 = null;


        try {
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:53:2: ( ( prim ( ',' )? )+ )
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:53:4: ( prim ( ',' )? )+
            {
            result = new LinkedList();
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:54:2: ( prim ( ',' )? )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( ((LA2_0>=NULL && LA2_0<=FALSE)||(LA2_0>=NUMBER && LA2_0<=STRING)||LA2_0==16) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:54:3: prim ( ',' )?
            	    {
            	    pushFollow(FOLLOW_prim_in_prims225);
            	    prim1=prim();
            	    _fsp--;

            	    result.add(prim1);
            	    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:54:37: ( ',' )?
            	    int alt1=2;
            	    int LA1_0 = input.LA(1);

            	    if ( (LA1_0==15) ) {
            	        alt1=1;
            	    }
            	    switch (alt1) {
            	        case 1 :
            	            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:54:37: ','
            	            {
            	            match(input,15,FOLLOW_15_in_prims229); 

            	            }
            	            break;

            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);


            }

        }
        
        finally {
        }
        return result;
    }
    // $ANTLR end prims


    // $ANTLR start prim
    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:55:1: prim returns [Object result] : ( NAME | STRING | NUMBER | NULL | TRUE | FALSE | dict );
    public final Object prim() throws RecognitionException {
        Object result = null;

        Token NAME2=null;
        Token STRING3=null;
        Token NUMBER4=null;
        Map dict5 = null;


        try {
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:56:2: ( NAME | STRING | NUMBER | NULL | TRUE | FALSE | dict )
            int alt3=7;
            switch ( input.LA(1) ) {
            case NAME:
                {
                alt3=1;
                }
                break;
            case STRING:
                {
                alt3=2;
                }
                break;
            case NUMBER:
                {
                alt3=3;
                }
                break;
            case NULL:
                {
                alt3=4;
                }
                break;
            case TRUE:
                {
                alt3=5;
                }
                break;
            case FALSE:
                {
                alt3=6;
                }
                break;
            case 16:
                {
                alt3=7;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("55:1: prim returns [Object result] : ( NAME | STRING | NUMBER | NULL | TRUE | FALSE | dict );", 3, 0, input);

                throw nvae;
            }

            switch (alt3) {
                case 1 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:56:4: NAME
                    {
                    NAME2=(Token)input.LT(1);
                    match(input,NAME,FOLLOW_NAME_in_prim247); 
                    result = NAME2.getText();

                    }
                    break;
                case 2 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:57:4: STRING
                    {
                    STRING3=(Token)input.LT(1);
                    match(input,STRING,FOLLOW_STRING_in_prim255); 
                    result = STRING3.getText().substring(1, STRING3.getText().length() - 1);

                    }
                    break;
                case 3 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:58:4: NUMBER
                    {
                    NUMBER4=(Token)input.LT(1);
                    match(input,NUMBER,FOLLOW_NUMBER_in_prim262); 
                    result = new Integer(NUMBER4.getText());

                    }
                    break;
                case 4 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:59:4: NULL
                    {
                    match(input,NULL,FOLLOW_NULL_in_prim269); 
                    result = null;

                    }
                    break;
                case 5 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:60:4: TRUE
                    {
                    match(input,TRUE,FOLLOW_TRUE_in_prim276); 
                    result = true;

                    }
                    break;
                case 6 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:61:4: FALSE
                    {
                    match(input,FALSE,FOLLOW_FALSE_in_prim283); 
                    result = false;

                    }
                    break;
                case 7 :
                    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:62:4: dict
                    {
                    pushFollow(FOLLOW_dict_in_prim290);
                    dict5=dict();
                    _fsp--;

                    result = dict5;

                    }
                    break;

            }
        }
        
        finally {
        }
        return result;
    }
    // $ANTLR end prim


    // $ANTLR start dict
    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:63:1: dict returns [ForMap result] : '{' (p1= prim ( '=' | '->' ) p2= prim ( ',' )? )* '}' ;
    public final Map dict() throws RecognitionException {
        Map result = null;

        Object p1 = null;

        Object p2 = null;


        try {
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:64:2: ( '{' (p1= prim ( '=' | '->' ) p2= prim ( ',' )? )* '}' )
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:64:4: '{' (p1= prim ( '=' | '->' ) p2= prim ( ',' )? )* '}'
            {
            result = new HashMap();
            match(input,16,FOLLOW_16_in_dict308); 
            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:65:7: (p1= prim ( '=' | '->' ) p2= prim ( ',' )? )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( ((LA5_0>=NULL && LA5_0<=FALSE)||(LA5_0>=NUMBER && LA5_0<=STRING)||LA5_0==16) ) {
                    alt5=1;
                }


                switch (alt5) {
            	case 1 :
            	    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:65:8: p1= prim ( '=' | '->' ) p2= prim ( ',' )?
            	    {
            	    pushFollow(FOLLOW_prim_in_dict313);
            	    p1=prim();
            	    _fsp--;

            	    if ( (input.LA(1)>=17 && input.LA(1)<=18) ) {
            	        input.consume();
            	        errorRecovery=false;
            	    }
            	    else {
            	        MismatchedSetException mse =
            	            new MismatchedSetException(null,input);
            	        recoverFromMismatchedSet(input,mse,FOLLOW_set_in_dict315);    throw mse;
            	    }

            	    pushFollow(FOLLOW_prim_in_dict325);
            	    p2=prim();
            	    _fsp--;

            	     result.put(p1, p2);
            	    // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:65:77: ( ',' )?
            	    int alt4=2;
            	    int LA4_0 = input.LA(1);

            	    if ( (LA4_0==15) ) {
            	        alt4=1;
            	    }
            	    switch (alt4) {
            	        case 1 :
            	            // C:\\Documents and Settings\\t2ladmin\\My Documents\\Projects\\2008\\OS3\\SyncLib\\src\\ac\\jp\\u_tokyo\\SyncLib\\valueParser\\Value.g:65:77: ','
            	            {
            	            match(input,15,FOLLOW_15_in_dict329); 

            	            }
            	            break;

            	    }


            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);

            match(input,19,FOLLOW_19_in_dict334); 

            }

        }
        
        finally {
        }
        return result;
    }
    // $ANTLR end dict


 

    public static final BitSet FOLLOW_prim_in_prims225 = new BitSet(new long[]{0x000000000001B872L});
    public static final BitSet FOLLOW_15_in_prims229 = new BitSet(new long[]{0x0000000000013872L});
    public static final BitSet FOLLOW_NAME_in_prim247 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_STRING_in_prim255 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMBER_in_prim262 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NULL_in_prim269 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TRUE_in_prim276 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FALSE_in_prim283 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_dict_in_prim290 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_16_in_dict308 = new BitSet(new long[]{0x0000000000093870L});
    public static final BitSet FOLLOW_prim_in_dict313 = new BitSet(new long[]{0x0000000000060000L});
    public static final BitSet FOLLOW_set_in_dict315 = new BitSet(new long[]{0x0000000000013870L});
    public static final BitSet FOLLOW_prim_in_dict325 = new BitSet(new long[]{0x000000000009B870L});
    public static final BitSet FOLLOW_15_in_dict329 = new BitSet(new long[]{0x0000000000093870L});
    public static final BitSet FOLLOW_19_in_dict334 = new BitSet(new long[]{0x0000000000000002L});

}